package com.casic.worklog;


import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;




/**
 * @author 黄志
 * @date 2019-09-13 14:09
 * @param
 * @return
 * @throws
 *
*/
@SpringBootApplication(scanBasePackages = {"com.casic.worklog"})
@MapperScan("com.casic.worklog.dao")
@ServletComponentScan("com.casic.worklog.filter")
public class WorklogApplication extends WebMvcConfigurerAdapter {

    private final static Logger LOGGER = LoggerFactory.getLogger(WorklogApplication.class);

    @Value("${web.upload}")
    private String uploadPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
       /* super.addResourceHandlers(registry);
        registry.addResourceHandler("/**").addResourceLocations(
                "file:"+uploadPath);
        LOGGER.info("自定义静态资源目录、此处功能用于文件映射");*/
    }


    public static void main (String[] args) {
        SpringApplication.run(WorklogApplication.class, args);
    }

}
